package com.example.service.impl;

import com.example.Dao.AdminuserMapper;

import com.example.entity.Adminusers;

import com.example.service.AdminuserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminuserServiceImpl implements AdminuserService {

    @Resource
    AdminuserMapper adminuserMapper;

    @Override
    public Adminusers geAdminUser(Adminusers adminuser) {
        return adminuserMapper.geAdminUser(adminuser);
    }

    @Override
    public PageInfo<Adminusers> queryAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize );
        List<Adminusers> list=adminuserMapper.queryAll();
        PageInfo<Adminusers> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }


    @Override
    public int deleteByID(Integer aduid) {
        return adminuserMapper.deleteByID(aduid);
    }

    @Override
    public Adminusers findById(Integer aduID) {
        return adminuserMapper.findById(aduID);
    }

    @Override
    public int update(Adminusers adminusers) {
        return adminuserMapper.update(adminusers);
    }

    @Override
    public int insert(Adminusers adminusers) {
        return adminuserMapper.insert(adminusers);
    }
}
